<template>
	<view class="page-header px-2 flex align-center justify-between shadow">
		<view v-if="canBack" class="iconfont icon-arrowLeft-fill back-icon" @tap="back"/>
		
		<view style="width: 500rpx;" class="font-lg font-weight-bold">{{title}}</view>
		<!-- <view class="font-lg">{{title}}</view> -->
		<slot></slot>
	</view>	
</template>

<script>
	export default {
		props: {
			title: {
				type: String,
				default: ""
			},
			canBack: {
				type: Boolean,
				default: true
			}
		},
		methods: {
			back() {
				uni.navigateBack({
					delta: 1
				})
			}
		}
	}
</script>

<style scoped>
	.page-header {
		height: 100rpx;
	}
	
	.back-icon {
		font-size: 50rpx;
	}
	.shadow{
		box-shadow: rgba(0, 0, 0, 0.07) 0px 1px 1px, rgba(0, 0, 0, 0.07) 0px 2px 2px, rgba(0, 0, 0, 0.07) 0px 4px 4px, rgba(0, 0, 0, 0.07) 0px 8px 8px, rgba(0, 0, 0, 0.07) 0px 16px 16px;
		
		
		/* https://getcssscan.com/css-box-shadow-examples?ref=producthunt */
	}
</style>
